package com.mxpio.erp.common.plm.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *  任务状态历史
 * @author qb
 * @date 2024-2-21
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PLM_PROJECT_TASK_STATUS_HISTORY")
@Schema(description="任务状态历史")
public class ProjectTaskStatusHistory extends BaseEntity {

    /**主键*/
    @Id
    @Generator
    @Column(name = "ID_", updatable = false)
    @Schema(description = "主键")
    private String id;

    @Column(name = "TASK_CODE_")
    @Schema(description = "任务编码")
    private String taskCode;

    @Column(name = "TASK_STATUS_BEFORE_")
    @Schema(description = "变更前任务状态")
    @Dict(dicCode = "ERP_PLM_TASK_EXECUTION_STATUS")
    private String taskStatusBefore ;

    @Column(name = "TASK_STATUS_AFTER_")
    @Schema(description = "变更后任务状态")
    @Dict(dicCode = "ERP_PLM_TASK_EXECUTION_STATUS")
    private String taskStatusAfter ;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "CHANGE_TIME_")
    @Schema(description = "变更时间")
    private java.util.Date changeTime;

    @Column(name = "CHANGE_USER_")
    @Schema(description = "变更人")
    @Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
    private String changeUser;

    @Column(name = "REASON_")
    @Schema(description = "备注")
    private String remark;
}
